package com.ihr360.payroll.service.attendancereport;

import com.ihr360.alps.ServiceDescriptor;
import com.ihr360.commons.entity.AuthUserInfo;
import com.ihr360.commons.vo.PageData;
import com.ihr360.excel.vo.CustomSpreadSheetValidateResult;
import com.ihr360.excel.vo.ImportRequest;
import com.ihr360.excel.vo.SpreadSheetValidatorRequest;
import com.ihr360.payroll.model.dto.attendance.report.AttendanceMonthlyReportSummary;
import com.ihr360.payroll.request.attendance.AttendanceOverTimeRequest;
import com.ihr360.payroll.request.attendance.AttendanceTakeNumberRequest;
import com.ihr360.payroll.type.AttendanceState;
import com.ihr360.rest.service.SimpleRestService;
import org.springframework.data.domain.Pageable;

import java.io.OutputStream;
import java.util.Date;


public interface AttendanceMonthlyReportSummaryService extends SimpleRestService<AttendanceMonthlyReportSummary, Long> {

    PageData<AttendanceMonthlyReportSummary> getSummaryList(AuthUserInfo userInfo, Pageable pageable);

    /**
     * 下载模板
     */
    void excelTemplateDownload(OutputStream out);

    /**
     * 导入考勤汇总
     */
    void importSummary(AuthUserInfo userInfo, ImportRequest importRequest);

    Long takeNumberSummary(AuthUserInfo userInfo, AttendanceTakeNumberRequest takeNumberRequest);

    void takeNumberMonthlyReport(AuthUserInfo userInfo, AttendanceTakeNumberRequest takeNumberRequest);

    /**
     * 查询考勤自定义字段
     */
    ServiceDescriptor serviceDescriptor(String companyId);

    /**
     * 考勤汇总锁定/撤销锁定
     */
    AttendanceOverTimeRequest lockAttendanceState(Long summaryId, AttendanceState state);

    Boolean checkSummaryExist(String companyId,int year,int month,Long salaryPlanId);

    /**
     * 校验导入的员工台账数据
     *
     * @param companyId
     * @param userId
     */
    CustomSpreadSheetValidateResult validateExcelData(String companyId, String userId,
                                                      Long salaryPlanId, Date summaryDate,
                                                      Date summaryStartDate,Date summaryEndDate,
                                                      Date salaryStartDate,Date salaryEndDate,
                                                      SpreadSheetValidatorRequest validatorRequest);
}